Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Implement Ollama Streaming Chat API with FastAPI #26

Closed
wants to merge 4 commits into from

Conversation

sourabh-josh
Copy link
Contributor

This PR implements a streaming chat API endpoint using FastAPI and Ollama LLM, featuring real-time response streaming with JSON formatting and completion signaling.

Changes

  • Added streaming chat endpoint with FastAPI
  • Implemented Ollama client integration
  • Added JSON response formatting with completion status
  • Added Ollama server setup script

New Files

  • main.py: FastAPI server implementation with streaming endpoint
  • ollama_client.py: Ollama integration and chat handling
  • ollama.sh: Server setup and initialization script

Before hitting endpoint

pull ollama
./ollama.sh pull

start ollama
./ollama.sh start

for more
./ollama.sh --help

API Endpoint

  • POST /chat
  • Request Body:
    {
      "message": "string"
    }
    
    
    #TODO: vector embeddings for input query
    refer `/llm/OllamaService.py:ollama_client method` left an comment for more help

@Selectus2 Selectus2 linked an issue Nov 26, 2024 that may be closed by this pull request
4 tasks
@Selectus2 Selectus2 closed this Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RAG setup for chatbot
3 participants